home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / packet / aprs75c / mk100k2a.txt < prev    next >
Text File  |  1996-04-17  |  14KB  |  257 lines

  1. MK100K2a.txt   in 75c        BUILDING 100K MAPS FROM USGS DATA
  2.                          (This program used to be called MKMAPHK)
  3.  
  4. Jack Cavanagh QBasic code to make APRS maps from USGS 100K:1 CD ROM
  5.  
  6. Version 1.0 released 23 Oct 95
  7. Version 2.0 Released 27 Dec 1995
  8. Version 2a  Bug Fix  15 Jan 96  Fixed file name bugs
  9. Edited  by WB4APR on 17 Aprl 1996
  10.  
  11.   Making APRS maps from the 100k CD is a two step process. First you use
  12. the CD programs to extract the raw map data from the CD to your hard 
  13. drive. The second step is to run MK100K2a.EXE which pulls the information
  14. from the hard disk files.  APRS distribution now includes one 2 mile map 
  15. made using this program.  Zoom into 3909N and 07636W below 2 miles.
  16.  
  17. STEP ONE
  18.  
  19.   It is assummed that you have already installed the CD support software
  20. on your hard disk following the instructions that come with the CD
  21. readme files.  Create a blank sub-directory on your hard drive to store
  22. the data.  I use the directory name 'dlg'.  Be sure you have enough
  23. room as 6 Meg or more of hard disk could be required.  Now run the
  24. program "extract.exe".  Do this from a maximum user application memory
  25. (>512k) DOS configuration.  This means no shell programs and minimum
  26. memory resident stuff. If this is not the case the program will appear
  27. to run but no files will be written to your hard drive.
  28.  
  29.   The extract program will present you with a map of the area of the
  30. USA covered by the CD.  At the top of the screen are various selection
  31. options. Use either the arrow keys and the enter keys or a mouse to
  32. select the "SELECT QUAD" option.  Move the cursor to the region of
  33. interest and click or hit ENTER.  The screen is redrawn with the
  34. selected grid divided into 15 minute grids.  Major rivers are shown
  35. along with major town names.  Now pick the option "SELECT LAYERS". A
  36. window will open and several options will be shown.  Unless you have
  37. some special need, select only the hydrography and transportation
  38. layers.  When you click the END SELECTION option, a "SELECT 15' GRID"
  39. option will become active.  Select it.  Move cursor to the regions of
  40. interest and click or hit ENTER.  A window will open up showing how
  41. much of your hard drive space will be eaten up.  Pick enough (usually
  42. up to four) grids that contain the area you want to make an APRS map
  43. off.  If you like me live near a grid corner, four will be required for
  44. a home town map. In the case of Bob Bruninga, who lives near the border
  45. of two major grids, this process may have to be repeated to get the
  46. four nearest 15' grids for his home town map.   Once you are satisfied
  47. with your selections, choose the "OUTPUT" option on the top bar.  The
  48. program will ask for a path to the directory on the hard drive to store
  49. the data.  After you respond, the program writes the info to hard
  50. drive.  If this appears to only take a few seconds, you probably need
  51. more lower memory. Exit the program. This takes two steps from the 15'
  52. menu through the main menu.
  53.  
  54.    Now check to see if the files are on your hard drive in the designated
  55. directory.  Make a note of the path to this directory.  The mapping
  56. program will want this information. NOTHING BUT CD MAP FILES MUST BE IN
  57. THIS DIRECTORY.  ANY OTHER FILE GUARANTEES A PROGRAM CRASH.  There is
  58. no way to know in advance what file names will come from the CD.  The
  59. program must try to process all files in the sub-directory. Please do NOT
  60. make any sub-sub-directory under the map file sub-directory either.
  61.  
  62. STEP TWO
  63.  
  64.   Execute the file MK100K2a.exe
  65. ------------------------------------
  66. For those who like to hack BASIC source code is available.  Execute
  67. QBasic from the DOS prompt (or Windows if you must) with the large
  68. memory option. This is done with the switch /AH. Unfortunately the
  69. requirement to use this switch precludes the use of Quick Basic that
  70. comes with DOS.  With all his money, Bill Gates really doesn't need to
  71. use bait and switch marketing.
  72.  
  73.         e.g.  qb /ah
  74.  
  75.    I wrote a one line batch file map.bat:
  76.       qb /ah MK100K2.bas
  77.  
  78.   Load the file MK100K2a.BAS. Run the BASIC code (Sh-F5).
  79. -------------------------------------
  80.    The program first asks for the path to the data files. I use
  81. 'c:\dlg'.   Next you are asked if the files came from the CD or from
  82. the internet. The CD files are 82 byte records with a carriage return 
  83. line feed and the internet files are only 80 bytes long.  Any single 
  84. answer other than "y" or "Y" will default to the 82 byte record length.
  85.  
  86.  
  87. Next you will be asked for a file name for the output.  The
  88. code takes care of file extensions.  For example, your response could
  89. be 'vafred' or 'mdannap'. ** Currently there is a bug, and you should 
  90. ONLY enter a 6 character name ***  Next you are asked for the latitude and
  91. longitude of the center of the APRS map.  Enter this information in
  92. degrees and minutes.  The APRS cursor is a good tool for identifying
  93. LAT/LONG.  Decimal parts of the minutes are allowed e.g. 38,56.5 is the 
  94. response for 38 degrees 56 minutes 30 seconds North latitude.  Do this
  95. carefully. Your coordinates must fall within one of the 15 minute grids
  96. extracted in step one.
  97.  
  98.    The final user input is the map radius in nautical miles.  This is
  99. actually one-half the North-South span of the map. The East-West span will
  100. be 4/3 times this value.  The level of road detail is controlled by the
  101. value of your input.  Interstate, U.S. Routes and major state routes will
  102. be extracted for all maps.  Secondary state routes (Class 3) will be
  103. extracted once the radius falls below 8 miles.  Class 4 roads, real local
  104. stuff, appear once the radius falls below 2 miles.  You have some
  105. control over this.  If the map radius is preceeded with a minus sign (-)
  106. then the default class of roads is decreased by one but not less than
  107. class 2. Use this in dense urban areas.  If the map radius is preceeded
  108. with a plus sign (+) then the default class of roads is increased by
  109. one but not more than class 4. Use this technique in sparse rural areas
  110. to get more cross-road landmarks.
  111.  
  112. MULTIPLE MAPS:
  113.    You will be presented with an option to make more than one map during
  114. this session. You can make one, four or nine maps. A crude figure shows 
  115. the relation of your input coordinates to the maps. For more that one map 
  116. a two letter tag is added to the first six characters of your map file name.  
  117. These tags are shown in the figure.  The map radius still applies to
  118. each individual map.
  119.  
  120. For the next 5 to 30 minutes the code will grind away. As map
  121. features are found they are plotted on the screen.  A status line on
  122. the top shows progress in the form of the total number of lines in the
  123. data file, a rapidly changing number of lines examined thus far and 
  124. the number of lines accumulated for the map.  As each file is
  125. processed, the program start time and file finish time is updated.
  126. When all files have been processed, the code tries to link as many
  127. short segments as possible into longer segments. Progress is shown as
  128. the maps lines change color to white (temporarily). The results are
  129. reported on the screen as the number of line segments and map points.
  130. Finally at the stroke of a key the display will show the map as it
  131. would appear in APRS.  Exit BASIC at this point and the default drive
  132. will contain two files with your file name and the extentions .dat and
  133. .map. The raw data file .dat can be reworked with the MAPFIX program to
  134. delete unwanted features and make a new .map file that fits APRS.
  135. There is also a file 'temp' which was used as a working file.  This is
  136. over written each time the program is run.
  137.  
  138. Hints and peculiarities:
  139.  
  140. ** NOTE ** the .MAP output file is always less than 3000 points, but 
  141. is usually so truncated as to be useless. DONT USE IT. The effect if 
  142. barely noticable, until you zoom in to small features and city blocks
  143. where the right angle streets will be totally decimated....You should
  144. load the .DAT file into MAPFIX and tell it to TASK-SCRUNCH with a 
  145. ratio of 1.2 (no more).  This map then should be saved as .map once
  146. you get it below 3000 points.  If it is below about 3500, I can usually
  147. find 500 points that can be eliminated using the +/- and EDIT-DELETE 
  148. commands.  Or you can TASK-TRIM to simply cut off themap edges...
  149.  
  150.    These maps have limited river and stream information. They are on
  151. the CD but if there is no internal coding to distinguish between a
  152. short little stream and a signifcant river unless the river had two
  153. distinct banks on the original maps.  Single line width rivers and
  154. streams are just not extracted.  What we are left with is every little
  155. pond that has a "shoreline". If these are not significant to you edit
  156. them out with MAPFIX command "Kill feature". The line attributes on the
  157. CD do not distinguish between coast lines, river banks or lake
  158. shorelines.  All are colored in dim cyan.
  159.  
  160. MK100K2a makes your map radius about 5% larger than the integer APRS scales
  161. of 1, 2, 4, 8, etc nautical miles.  This is so that APRS will load the 
  162. map at the indicated range with out a PERFECT placement of the cursor at
  163. the center.
  164.  
  165.   The USGS Data User's Guide implies that political boundary and public
  166. land survey data is on the CD. This is not the case for the optional
  167. format CD.  If city or county lines are significant to you, import them
  168. with MAPFIX from a map made from the 2,000,000:1 CD.
  169.  
  170.     I encourage all those who make changes, improvements, bug fixes and
  171. enhancements to this code to document each change by adding a comment
  172. to each modified or added source code line. A simple 'v2 or your initials,
  173. callsign, etc 'jfc will do nicely.
  174.  
  175.      Some users have reported problems with no maps being produced. This
  176. appears to caused by a user map center and radius that does not fall within
  177. the region covered by the files.  The already verbose error message has
  178. been expanded to reveal records 11 through 14 of the last file examined.
  179. These records define the four corners of the map data which can be compared
  180. with your input values to see were the mistake was made. It will be either 
  181. a wrong map center or a bad choice of files.
  182.  
  183.   MK100k2a halves the number of points extracted for shorelines as a brute
  184. force reduction technique.  Also some shorelines are so long, that MK100k2a
  185. can not find the beginnning or end in the data.  If such a line is omitted
  186. though, it is usually very noticable.
  187.  
  188.   The big change in 2.0 was the choice of making one, four or nine maps at 
  189. time.  The maps are centered about the user's lat/long input.  The user's 
  190. map radius is increased by five percent internally so that the maps overlap. 
  191.  
  192.   Remember the map data is based on 15 minute USGS maps, although 7.5 minute
  193. maps may have been digitized. The maps extend 15 nautical miles north-south
  194. everywhere.  The east-west extent depends on latitude.  For the continental
  195. United States, this can range between about 12.6 nautical miles for the 
  196. Florida Keys down to about 9.8 nautical miles for International Falls, MN.
  197. An APRS map is 4/3 as wide as it is tall. Thus a 1 radius mile APRS map
  198. covers 2 nautical miles north-south and about 2.67 nautical miles east-west. 
  199. My point here is that even a one mile map could require extracting data 
  200. from as many as 4 each of the transportation and hydrography map files and 
  201. typically require two sets of these map files.
  202.  
  203. APR COMMENT.  Due to the TALL 15 minute box of raw data, and the FAT wide
  204. APRS display format, a better extraction method is as follows:
  205.  
  206.     * * * * * * *  Two 4.2 mile maps but ONLY if the area is very sparse
  207.     *           *
  208.     *           *        ----------+----------  Eight 2.1 mile maps
  209.     * - - - - - *        |         |         |  should cover most mid USA
  210.     *           *        |         |         |  latitudes quite well
  211.     *           *        +--------(*)--------+
  212.     * * * * * * *        |         |         |
  213.                          |         |         |
  214.                          +---------+---------+
  215.                          |         |         |
  216.                          |         |         |
  217.                          +--------(*)--------+
  218.                          |         |         |
  219.                          |         |         |
  220.                          ----------+----------
  221. I have asked jack to consider this multiple map profile.  In the mean time
  222. you can just select his 4 map option twice, once for the upper center of
  223. the 15 min cell, and again for the bottom center
  224.  
  225. JACK's Thoughts on any future Version 3
  226.  
  227. - The multi-map production feature could be expanded to include 16 or 25
  228.   maps at once.  However, drawing little boxes on the input screen is
  229.   tedious, boring and not much fun.  Does anyone have any ideas on how
  230.   to identify each map when making this many at a time?
  231.  
  232. - There are one or two bugs that cause a line segment to be missed now
  233.   and then.  If I transport this code to a faster machine (my wife's) I
  234.   may be able to find and fix them.
  235.  
  236. - I am still wary of how this code will perform in regions with extensive
  237.   shorelines such as tidewater Virginia or Lousiana bayous.  I need user 
  238.   feedback on this.
  239.  
  240. - No Windows support is planned. Anyone skilled in Visual Basic or Visual C
  241.   is more than welcome to take a crack at this.
  242.  
  243. - If there is an overwhelming need for railroads, canals, trails, etc, a
  244.   switch could be added.
  245.  
  246.  
  247.    Comments, bugs and suggestions are welcome. Contact me by packet
  248. at kb4xf@kc4asf.va.usa.na on packet or 223 N. Randolph Rd., Falmouth,
  249. VA 22405 by snail mail.  I will be on the Internet in a few months.
  250.  
  251. Happy mapmaking and APRS operating,   Jack, KB4XF
  252.  
  253. Jack Cavanagh, KB4XF
  254. Falmouth, VA
  255. kb4xf@kc4asf.va.usa
  256.  
  257.